<template>
    <el-tabs v-model="activeTab">
        <el-tab-pane label="帐号" name="account">
            <account :usage="3"></account>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="发布规则" name="rule">
            <PublishRuleList></PublishRuleList>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="发布任务" name="target">
            <PublishTask :usage="3"></PublishTask>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="发布数据" name="jobdata">
            <Article @handleRow="handleCrawle" buttonName="发布"></Article>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="发布计划" name="job">
            <PublishJobList></PublishJobList>
        </el-tab-pane>
    </el-tabs>
</template>

<script>
const { ipcRenderer: ipc } = require('electron')
import { UsageScope } from "@/entities/Constant"
import Account from "@/views/media/common/Account"
import Article from "@/views/media/common/Article"
import PublishTask from "@/views/media/publish/publishTask"
import PublishJobList from "@/views/media/publish/publishJobList"
import PublishRuleList from "@/views/media/publish/publishRuleList"
export default {
    name: "Media",
    components: {
        Account,
        Article,
        PublishTask,
        PublishJobList,
        PublishRuleList
    },
    data() {
        return {
            activeTab: "account",
        }
    },
    methods: {
        handleCrawle(row) {
            ipc.send("puppeteer", { usageScope: UsageScope.Publisher, data: row, raw: 1 })
        }
    },
}
</script>